import { createWebHistory, createRouter } from 'vue-router'
// 引入组件
import Login from '../views/Login/index.vue'
import NotFound from '../views/NotFound/404.vue'

import HomeRoute from './modules/home'
import AboutRoute from './modules/about'
import ProductRoute from './modules/product'
// 配置路由规则

// /home/dashboard
export const routes = [
  {
    path: '/',
    redirect: '/home',
    hidden: true
  },
  HomeRoute,
  AboutRoute,
  ProductRoute,
  { path: '/login', component: Login, name: 'login', hidden: true },
  { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound, hidden: true }
]
// 创建路由对象
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
